//
// Toolbar
// --------------------------------------------------


// Wrapper and base class
//
// Provide a static toolbar from which we expand to create full-width, fixed, and
// other navbar variations.

.navbar-toolbar {
  // position: relative;
  min-height: $navbar-toolbar-height; // Ensure a toolbar always shows (e.g., without a .navbar-brand in collapsed mode)
  margin-bottom: $navbar-toolbar-margin-bottom;
  // border: 1px solid transparent;

  // // Prevent floats from breaking the navbar
  // .clearfix();

  @media (min-width: $grid-float-breakpoint) {
    border-radius: $navbar-toolbar-border-radius;
  }
}


// Navbar heading
//
// Groups `.navbar-brand` and `.navbar-toggle` into a single component for easy
// styling of responsive aspects.

// .navbar-header {
//   .clearfix();

//   @media (min-width: $grid-float-breakpoint) {
//     float: left;
//   }
// }


// Navbar collapse (body)
//
// Group your navbar content into this for easy collapsing and expanding across
// various device sizes. By default, this content is collapsed when <768px, but
// will expand past that for a horizontal display.
//
// To start (on mobile devices) the navbar links, forms, and buttons are stacked
// vertically and include a `max-height` to overflow in case you have too much
// content for the user's viewport.

// .navbar-toolbar .navbar-collapse {
//   max-height: 340px;
//   overflow-x: visible;
//   padding-right: $navbar-toolbar-padding-horizontal;
//   padding-left:  $navbar-toolbar-padding-horizontal;
//   border-top: 1px solid transparent;
//   box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
//   .clearfix();
//   -webkit-overflow-scrolling: touch;

//   &.in {
//     overflow-y: auto;
//   }

//   @media (min-width: $grid-float-breakpoint) {
//     width: auto;
//     border-top: 0;
//     box-shadow: none;

//     &.collapse {
//       display: block !important;
//       height: auto !important;
//       padding-bottom: 0; // Override default setting
//       overflow: visible !important;
//     }

//     &.in {
//       overflow-y: auto;
//     }

//     // Undo the collapse side padding for navbars with containers to ensure
//     // alignment of right-aligned contents.
//     .navbar-fixed-top &,
//     .navbar-static-top &,
//     .navbar-fixed-bottom & {
//       padding-left: 0;
//       padding-right: 0;
//     }
//   }
// }


// Both navbar header and collapse
//
// When a container is present, change the behavior of the header and collapse.

// .navbar-toolbar > .container,
// .navbar-toolbar > .container-fluid {
//   > .navbar-header,
//   > .navbar-collapse {
//     margin-right: -$navbar-toolbar-padding-horizontal;
//     margin-left:  -$navbar-toolbar-padding-horizontal;

//     @media (min-width: $grid-float-breakpoint) {
//       margin-right: 0;
//       margin-left:  0;
//     }
//   }
// }


//
// Navbar alignment options
//
// Display the navbar across the entirity of the page or fixed it to the top or
// bottom of the page.

// Static top (unfixed, but 100% wide) navbar
.navbar-toolbar .navbar-static-top {
  z-index: $zindex-toolbar;
  // border-width: 0 0 1px;

  // @media (min-width: $grid-float-breakpoint) {
  //   border-radius: 0;
  // }
}

// Fix the top/bottom navbars when screen real estate supports it
.navbar-toolbar .navbar-fixed-top,
.navbar-toolbar .navbar-fixed-bottom {
  // position: fixed;
  // right: 0;
  // left: 0;
  z-index: $zindex-toolbar-fixed;

  // // Undo the rounded corners
  // @media (min-width: $grid-float-breakpoint) {
  //   border-radius: 0;
  // }
}
// .navbar-toolbar .navbar-fixed-top {
//   top: 0;
//   border-width: 0 0 1px;
// }
// .navbar-toolbar .navbar-fixed-bottom {
//   bottom: 0;
//   margin-bottom: 0; // override .navbar defaults
//   border-width: 1px 0 0;
// }


// Brand/project name

.navbar-toolbar .navbar-brand {
  // float: left;
  height: $navbar-toolbar-height;
  padding: $navbar-toolbar-padding-vertical $navbar-toolbar-padding-horizontal;
  font-size: $navbar-toolbar-brand-font-size;
  font-weight: bold;
  // line-height: $line-height-computed;
  //
  // &:hover,
  // &:focus {
  //   text-decoration: none;
  // }

  @media (min-width: $grid-float-breakpoint) {
    .navbar > .container &,
    .navbar > .container-fluid & {
      margin-left: -$navbar-toolbar-padding-horizontal;
    }
  }
}


// Navbar toggle
//
// Custom button for toggling the `.navbar-collapse`, powered by the collapse
// JavaScript plugin.

.navbar-toolbar .navbar-toggle {
  @include navbar-vertical-align($input-height-base, $navbar-toolbar-height);
  // position: relative;
  // float: right;
  margin-right: $navbar-toolbar-padding-horizontal;
  // padding: $padding-base-vertical 10px;
  // background-color: transparent;
  // background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
  // border: 1px solid transparent;
  // border-radius: $border-radius-base;

  // // Bars
  // .icon-bar {
  //   display: block;
  //   width: 22px;
  //   height: 2px;
  //   border-radius: 1px;
  // }
  // .icon-bar + .icon-bar {
  //   margin-top: 4px;
  // }

  // @media (min-width: $grid-float-breakpoint) {
  //   display: none;
  // }
}


// Navbar nav links
//
// Builds on top of the `.nav` components with its own modifier class to make
// the nav the full height of the horizontal nav (above 768px).

.navbar-toolbar .navbar-nav {
  margin: floor(($navbar-toolbar-padding-vertical / 2)) - $navbar-toolbar-padding-horizontal;

  > li {
    position: relative;

    > a {
      padding: $navbar-toolbar-padding-vertical $navbar-padding-horizontal;
      // padding-top:    10px;
      // padding-bottom: 10px;
      // line-height: $line-height-computed;
      &:hover,
      &:focus {
        text-decoration: underline;
      }
    }

    > .dropdown-menu {
      margin-top: 1px;
    }
  }

  > .active > a {
    font-weight: bold;

    &::before {
      position: absolute;
      bottom: -1px;
      left: 50%;
      display: inline-block;
      margin-left: -8px; // value should match border-width below
      content: "";
      border-right: 8px solid transparent;
      border-bottom: 8px solid transparent;
      border-left: 8px solid transparent;
    }

    &::after {
      position: absolute;
      bottom: -1px;
      left: 50%;
      display: inline-block;
      margin-left: -7px; // value should match border-width below
      content: "";
      border-right: 7px solid transparent;
      border-bottom: 7px solid transparent;
      border-left: 7px solid transparent;
    }
  }

  // @media (max-width: $grid-float-breakpoint-max) {
  //   // Dropdowns get custom display when collapsed
  //   .open .dropdown-menu {
  //     position: static;
  //     float: none;
  //     width: auto;
  //     margin-top: 0;
  //     background-color: transparent;
  //     border: 0;
  //     box-shadow: none;
  //     > li > a,
  //     .dropdown-header {
  //       padding: 5px 15px 5px 25px;
  //     }
  //     > li > a {
  //       line-height: $line-height-computed;
  //       &:hover,
  //       &:focus {
  //         background-image: none;
  //       }
  //     }
  //   }
  // }

  // Uncollapse the nav
  @media (min-width: $grid-float-breakpoint) {
    // float: left;
    margin: 0;

    > li {
      // float: left;
      > a {
        padding-top: $navbar-toolbar-padding-vertical;
        padding-bottom: $navbar-toolbar-padding-vertical;
      }
    }

    &.navbar-right:last-child {
      margin-right: -$navbar-toolbar-padding-horizontal;
    }
  }
}


// Component alignment
//


// Navbar form
//
// Extension of the `.form-inline` with some extra flavor for optimum display in
// our navbars.

.navbar-toolbar .navbar-form {
  // Vertically center in expanded, horizontal navbar
  @include navbar-vertical-align($navbar-toolbar-height, $navbar-toolbar-height);
  padding: 10px $navbar-toolbar-padding-horizontal;
  margin-right: -$navbar-toolbar-padding-horizontal;
  margin-left: -$navbar-toolbar-padding-horizontal;

  > .input-group .form-control {
    @include navbar-vertical-align($input-height-base, $navbar-toolbar-height);
  }

  .form-group {
    @media (max-width: $grid-float-breakpoint-max) {
      margin-bottom: 5px;
    }
  }

  // Undo 100% width for pull classes
  @media (min-width: $grid-float-breakpoint) {
    padding-top: 0;
    padding-bottom: 0;
    margin-right: 0;
    margin-left: 0;

    // Outdent the form if last child to line up with content down the page
    &.navbar-right:last-child {
      margin-right: -$navbar-toolbar-padding-horizontal;
    }
  }

  .form-control {
    height: $input-height-base;
    padding: $padding-base-vertical $padding-base-horizontal;
  }
}


// Dropdown menus
.navbar-toolbar .dropdown-menu {
  border-top: 1px none;
}

// Buttons in navbars
//
// Vertically center a button within a navbar (when *not* in a form).

.navbar-toolbar {
  &.navbar-btn,
  &.navbar .btn {
    @include navbar-vertical-align($input-height-base, $navbar-toolbar-height);
    padding: $padding-base-vertical $padding-base-horizontal;

    &.btn-sm {
      @include navbar-vertical-align($input-height-small, $navbar-toolbar-height);
      padding: $padding-small-vertical $padding-small-horizontal;
    }

    &.btn-xs {
      @include navbar-vertical-align(20, $navbar-toolbar-height);
      padding: $padding-xs-vertical $padding-xs-horizontal;
    }
  }
}


// Text in navbars
//
// Add a class to make any element properly align itself vertically within the navbars.

.navbar-toolbar .navbar-text {
  @include navbar-vertical-align($line-height-computed, $navbar-toolbar-height);

  // @media (min-width: $grid-float-breakpoint) {
  //   float: left;
  //   margin-left: $navbar-toolbar-padding-horizontal;
  //   margin-right: $navbar-toolbar-padding-horizontal;

  //   // Outdent the form if last child to line up with content down the page
  //   &.navbar-right:last-child {
  //     margin-right: 0;
  //   }
  // }
}

// Alternate navbars
// --------------------------------------------------

// Default navbar
.navbar-toolbar.navbar-default {
  background-color: $navbar-toolbar-default-bg;
  border-color: $navbar-toolbar-default-border;

  .navbar-brand {
    color: $navbar-toolbar-default-brand-color;

    &:hover,
    &:focus {
      color: $navbar-toolbar-default-brand-hover-color;
      background-color: $navbar-toolbar-default-brand-hover-bg;
    }

    > .caret {
      border-top-color: $navbar-toolbar-default-brand-color;
      border-bottom-color: $navbar-toolbar-default-brand-color;
    }
  }

  .navbar-text {
    color: $navbar-toolbar-default-color;
  }

  .navbar-nav {
    > li > a {
      color: $navbar-toolbar-default-link-color;

      &:hover,
      &:focus {
        color: $navbar-toolbar-default-link-hover-color;
        background-color: $navbar-toolbar-default-link-hover-bg;
      }
    }

    > .active > a {
      &,
      &:hover,
      &:focus {
        color: $navbar-toolbar-default-link-active-color;
        background-color: $navbar-toolbar-default-link-active-bg;
      }

      &::before {
        border-bottom: 8px solid $navbar-toolbar-default-border;
      }

      &::after {
        border-bottom: 7px solid $dropdown-bg;
      }
    }

    > .disabled > a {
      &,
      &:hover,
      &:focus {
        color: $navbar-toolbar-default-link-disabled-color;
        background-color: $navbar-toolbar-default-link-disabled-bg;
      }
    }
  }

  .navbar-toggle {
    border-color: $navbar-toolbar-default-toggle-border-color;

    &:hover,
    &:focus {
      background-color: $navbar-toolbar-default-toggle-hover-bg;
    }

    .icon-bar {
      background-color: $navbar-toolbar-default-toggle-icon-bar-bg;
    }
  }

  .navbar-collapse,
  .navbar-form {
    border-color: darken($navbar-toolbar-default-bg, 7%);
  }

  // Dropdown menu items
  .navbar-nav {
    // Remove background color from open dropdown
    > .open > a {
      &,
      &:hover,
      &:focus {
        color: $navbar-toolbar-default-link-active-color;
        background-color: $navbar-toolbar-default-link-active-bg;
      }
    }

    @media (max-width: $grid-float-breakpoint-max) {
      // Dropdowns get custom display when collapsed
      .open .dropdown-menu {
        > li > a {
          color: $navbar-toolbar-default-link-color;

          &:hover,
          &:focus {
            color: $navbar-toolbar-default-link-hover-color;
            background-color: $navbar-toolbar-default-link-hover-bg;
          }
        }

        > .active > a {
          &,
          &:hover,
          &:focus {
            color: $navbar-toolbar-default-link-active-color;
            background-color: $navbar-toolbar-default-link-active-bg;
          }
        }

        > .disabled > a {
          &,
          &:hover,
          &:focus {
            color: $navbar-toolbar-default-link-disabled-color;
            background-color: $navbar-toolbar-default-link-disabled-bg;
          }
        }
      }
    }
  }


  // Links in navbars
  //
  // Add a class to ensure links outside the navbar nav are colored correctly.

  .navbar-link {
    color: $navbar-toolbar-default-link-color;

    &:hover {
      color: $navbar-toolbar-default-link-hover-color;
    }
  }

  .btn-link {
    color: $navbar-toolbar-default-link-color;

    &:hover,
    &:focus {
      color: $navbar-toolbar-default-link-hover-color;
    }

    &[disabled],
    fieldset[disabled] & {
      &:hover,
      &:focus {
        color: $navbar-toolbar-default-link-disabled-color;
      }
    }
  }
}

// Inverse navbar

.navbar-toolbar.navbar-inverse {
  background-color: $navbar-toolbar-inverse-bg;
  border-color: $navbar-toolbar-inverse-border;

  .navbar-brand {
    color: $navbar-toolbar-inverse-brand-color;

    &:hover,
    &:focus {
      color: $navbar-toolbar-inverse-brand-hover-color;
      background-color: $navbar-toolbar-inverse-brand-hover-bg;
    }

    > .caret {
      border-top-color: $navbar-toolbar-inverse-brand-color;
      border-bottom-color: $navbar-toolbar-inverse-brand-color;
    }
  }

  .navbar-text {
    color: $navbar-toolbar-inverse-color;
  }

  .navbar-nav {
    > li > a {
      color: $navbar-toolbar-inverse-link-color;

      &:hover,
      &:focus {
        color: $navbar-toolbar-inverse-link-hover-color;
        background-color: $navbar-toolbar-inverse-link-hover-bg;
      }
    }

    > .active > a {
      &,
      &:hover,
      &:focus {
        color: $navbar-toolbar-inverse-link-active-color;
        background-color: $navbar-toolbar-inverse-link-active-bg;
      }

      &::before {
        border-bottom: 8px solid $navbar-toolbar-inverse-border;
      }

      &::after {
        border-bottom: 7px solid $dropdown-bg;
      }
    }

    > .disabled > a {
      &,
      &:hover,
      &:focus {
        color: $navbar-toolbar-inverse-link-disabled-color;
        background-color: $navbar-toolbar-inverse-link-disabled-bg;
      }
    }
  }

  // Darken the responsive nav toggle
  .navbar-toggle {
    border-color: $navbar-toolbar-inverse-toggle-border-color;

    &:hover,
    &:focus {
      background-color: $navbar-toolbar-inverse-toggle-hover-bg;
    }

    .icon-bar {
      background-color: $navbar-toolbar-inverse-toggle-icon-bar-bg;
    }
  }

  .navbar-collapse,
  .navbar-form {
    border-color: darken($navbar-toolbar-inverse-bg, 7%);
  }

  // Dropdowns
  .navbar-nav {
    > .open > a {
      &,
      &:hover,
      &:focus {
        color: $navbar-toolbar-inverse-link-active-color;
        background-color: $navbar-toolbar-inverse-link-active-bg;
      }
    }

    @media (max-width: $grid-float-breakpoint-max) {
      // Dropdowns get custom display
      .open .dropdown-menu {
        > .dropdown-header {
          border-color: $navbar-toolbar-inverse-border;
        }

        .divider {
          background-color: $navbar-toolbar-inverse-border;
        }

        > li > a {
          color: $navbar-toolbar-inverse-link-color;

          &:hover,
          &:focus {
            color: $navbar-toolbar-inverse-link-hover-color;
            background-color: $navbar-toolbar-inverse-link-hover-bg;
          }
        }

        > .active > a {
          &,
          &:hover,
          &:focus {
            color: $navbar-toolbar-inverse-link-active-color;
            background-color: $navbar-toolbar-inverse-link-active-bg;
          }
        }

        > .disabled > a {
          &,
          &:hover,
          &:focus {
            color: $navbar-toolbar-inverse-link-disabled-color;
            background-color: $navbar-toolbar-inverse-link-disabled-bg;
          }
        }
      }
    }
  }

  .navbar-link {
    color: $navbar-toolbar-inverse-link-color;

    &:hover {
      color: $navbar-toolbar-inverse-link-hover-color;
    }
  }

  .btn-link {
    color: $navbar-toolbar-inverse-link-color;

    &:hover,
    &:focus {
      color: $navbar-toolbar-inverse-link-hover-color;
    }

    &[disabled],
    fieldset[disabled] & {
      &:hover,
      &:focus {
        color: $navbar-toolbar-inverse-link-disabled-color;
      }
    }
  }
}
